From 5a2ee478f4a6f22a10bf7349350c6a432503b939 Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Wed, 21 Feb 2007 19:12:16 +0000 Subject: [PATCH] hvm: local_events_need_delivery() must take into account VLAPIC/PIC status. Signed-off-by: Keir Fraser --- xen/include/asm-x86/event.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/xen/include/asm-x86/event.h b/xen/include/asm-x86/event.h index 475339550b..86f6653f83 100644 --- a/xen/include/asm-x86/event.h +++ b/xen/include/asm-x86/event.h @@ -10,6 +10,7 @@ #define __ASM_EVENT_H__ #include +#include /* cpu_has_pending_irq() */ static inline void vcpu_kick(struct vcpu *v) { @@ -37,9 +38,9 @@ static inline void vcpu_mark_events_pending(struct vcpu *v) static inline int local_events_need_delivery(void) { struct vcpu *v = current; - /* Note: Bitwise operations result in fast code with no branches. */ - return (!!vcpu_info(v, evtchn_upcall_pending) & - !vcpu_info(v, evtchn_upcall_mask)); + return ((vcpu_info(v, evtchn_upcall_pending) && + !vcpu_info(v, evtchn_upcall_mask)) || + (is_hvm_vcpu(v) && cpu_has_pending_irq(v))); } static inline int local_event_delivery_is_enabled(void) -- 2.30.2